Optimal. Leaf size=64 \[ -\frac {1}{6} \tanh ^{-1}\left (\frac {x}{2}\right ) (d+4 f+16 h)+\frac {1}{3} \tanh ^{-1}(x) (d+f+h)-\frac {1}{6} (e+g) \log \left (1-x^2\right )+\frac {1}{6} (e+4 g) \log \left (4-x^2\right )+h x \]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 7, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {1673, 1676, 1166, 207, 1247, 632, 31} \begin {gather*} -\frac {1}{6} \tanh ^{-1}\left (\frac {x}{2}\right ) (d+4 f+16 h)+\frac {1}{3} \tanh ^{-1}(x) (d+f+h)-\frac {1}{6} (e+g) \log \left (1-x^2\right )+\frac {1}{6} (e+4 g) \log \left (4-x^2\right )+h x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 207
Rule 632
Rule 1166
Rule 1247
Rule 1673
Rule 1676
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2+g x^3+h x^4}{4-5 x^2+x^4} \, dx &=\int \frac {x \left (e+g x^2\right )}{4-5 x^2+x^4} \, dx+\int \frac {d+f x^2+h x^4}{4-5 x^2+x^4} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {e+g x}{4-5 x+x^2} \, dx,x,x^2\right )+\int \left (h+\frac {d-4 h+(f+5 h) x^2}{4-5 x^2+x^4}\right ) \, dx\\ &=h x+\frac {1}{6} (-e-g) \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,x^2\right )+\frac {1}{6} (e+4 g) \operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,x^2\right )+\int \frac {d-4 h+(f+5 h) x^2}{4-5 x^2+x^4} \, dx\\ &=h x-\frac {1}{6} (e+g) \log \left (1-x^2\right )+\frac {1}{6} (e+4 g) \log \left (4-x^2\right )-\frac {1}{3} (d+f+h) \int \frac {1}{-1+x^2} \, dx+\frac {1}{3} (d+4 f+16 h) \int \frac {1}{-4+x^2} \, dx\\ &=h x-\frac {1}{6} (d+4 f+16 h) \tanh ^{-1}\left (\frac {x}{2}\right )+\frac {1}{3} (d+f+h) \tanh ^{-1}(x)-\frac {1}{6} (e+g) \log \left (1-x^2\right )+\frac {1}{6} (e+4 g) \log \left (4-x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 81, normalized size = 1.27 \begin {gather*} \frac {1}{12} (-2 \log (1-x) (d+e+f+g+h)+\log (2-x) (d+2 (e+2 f+4 g+8 h))+2 \log (x+1) (d-e+f-g+h)-\log (x+2) (d-2 e+4 f-8 g+16 h)+12 h x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x+f x^2+g x^3+h x^4}{4-5 x^2+x^4} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 4.72, size = 72, normalized size = 1.12 \begin {gather*} h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} \log \left (x - 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.43, size = 80, normalized size = 1.25 \begin {gather*} h x - \frac {1}{12} \, {\left (d + 4 \, f - 8 \, g + 16 \, h - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{6} \, {\left (d + f - g + h - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{6} \, {\left (d + f + g + h + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{12} \, {\left (d + 4 \, f + 8 \, g + 16 \, h + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 145, normalized size = 2.27 \begin {gather*} -\frac {d \ln \left (x +2\right )}{12}+\frac {d \ln \left (x -2\right )}{12}-\frac {d \ln \left (x -1\right )}{6}+\frac {d \ln \left (x +1\right )}{6}+\frac {e \ln \left (x +2\right )}{6}+\frac {e \ln \left (x -2\right )}{6}-\frac {e \ln \left (x -1\right )}{6}-\frac {e \ln \left (x +1\right )}{6}-\frac {f \ln \left (x +2\right )}{3}+\frac {f \ln \left (x -2\right )}{3}-\frac {f \ln \left (x -1\right )}{6}+\frac {f \ln \left (x +1\right )}{6}+\frac {2 g \ln \left (x +2\right )}{3}+\frac {2 g \ln \left (x -2\right )}{3}-\frac {g \ln \left (x -1\right )}{6}-\frac {g \ln \left (x +1\right )}{6}+h x -\frac {4 h \ln \left (x +2\right )}{3}+\frac {4 h \ln \left (x -2\right )}{3}-\frac {h \ln \left (x -1\right )}{6}+\frac {h \ln \left (x +1\right )}{6} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.24, size = 72, normalized size = 1.12 \begin {gather*} h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} \log \left (x - 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.81, size = 90, normalized size = 1.41 \begin {gather*} h\,x-\ln \left (x-1\right )\,\left (\frac {d}{6}+\frac {e}{6}+\frac {f}{6}+\frac {g}{6}+\frac {h}{6}\right )+\ln \left (x+1\right )\,\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}\right )+\ln \left (x-2\right )\,\left (\frac {d}{12}+\frac {e}{6}+\frac {f}{3}+\frac {2\,g}{3}+\frac {4\,h}{3}\right )-\ln \left (x+2\right )\,\left (\frac {d}{12}-\frac {e}{6}+\frac {f}{3}-\frac {2\,g}{3}+\frac {4\,h}{3}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________